<{include file=$module.'/header.php'}>
<div class="page address">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back"><i class="fa fa-arrow-left"></i></a>
		<h1 class="title">修改密码</h1>
	</header>
	<{include file=$module.'/nav.php'}>
	<div class="content">
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title label">原密码</div>
							<div class="item-input">
								<input type="text" name="oldpwd" class="realname" placeholder="请输入原密码" value="">
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title label">新密码</div>
							<div class="item-input">
								<input type="text" name="pwd" class="realname" placeholder="请输入新密码" value="">
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title label">确认密码</div>
							<div class="item-input">
								<input type="text" name="pwd2" class="realname" placeholder="请输入确认密码" value="">
								
							</div>
						</div>
					</div>
				</li>
			</ul>
		</div>
		
		<div class="content-padded">
			<a href="javascript:;" class="button button-fill button-big button-danger submit-com" data-id="<{$info.id}>">修改</a>
		</div>
		</form>
	</div>
</div>

<script src="/static/app/js/qcing.js"></script>
<script src="/static/app/js/upload.js"></script>
<script>
$(function(){

	$(document).on('click', '.submit-com', function(){
		var $this = $(this);
		var order_id = $this.data('id');
		if($this.hasClass('disabled')) {
			return false;
		}
		var oldpwd = $.trim($('[name="oldpwd"]').val());
		if(!oldpwd) {
			$.toast('请输入原密码');
			return false;
		}
		var pwd = $.trim($('[name="pwd"]').val());
		if(!pwd) {
			$.toast('请输入新密码');
			return false;
		}
		var pwd2 = $.trim($('[name="pwd2"]').val());
		if(!pwd2) {
			$.toast('请输入确认新密码');
			return false;
		}
		if(pwd != pwd2) {
			$.toast('两次密码不一致');
			return false;
		}
		$this.addClass('disabled');
		$.post("/<{$routeUrl}>/<{$action}>", {do:'pwd',pwd:pwd}, function(response){
			if(response.code == 0){
				$this.removeClass('disabled');
				$.toast(response.msg);
				return false;
			}
			if(response.code == 1){
				$.toast(response.msg, "/<{$module}>/login/logout");
			}
		});
	})
});

</script>
<{include file=$module.'/footer.php'}>